#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define N 256

void insert(char *s1, char *s2, int f);

int main() {

	char c1[N] = { 0 }, c2[N] = { 0 };
	scanf("%s", c1);
	scanf("%s", c2);
	int index;
	scanf("%d", &index);

	insert(c1, c2, index);
	printf("%s", c1);

	return 0;
}

void insert(char *s1, char *s2, int f) {
	int i, len = strlen(s1);
	char *ex = malloc(strlen(s1) > strlen(s2) ? strlen(s1) : strlen(s2));
	for (i = f; i <= len; i++) ex[i - f] = s1[i];
	s1[f] = '\0';
	
	strcat(s1, s2);
	strcat(s1, ex);
	free(ex);
}


